import { useRecoilValue, useSetRecoilState } from "recoil";

import { effectSetDemoState } from "./store";

export default function EffectSetDemo() {
  const effectSetDemo = useRecoilValue(effectSetDemoState);
  const setEffectSetDemo = useSetRecoilState(effectSetDemoState)

  return (
    <div>
      <h1>Effect Set Demo</h1>
      <p>{effectSetDemo}</p>
      <button onClick={() => setEffectSetDemo("Set a new value") }>Set New</button>
    </div>
  );
}
